package org.scala.javafx.control

import javafx.event.EventHandler
import javafx.scene.control.Control
import javafx.scene.control.Skin
import javafx.scene.input.MouseEvent
 
class ArrowButton(title: String) extends Control {
  val skin = new ArrowButtonSkin(this)
  this.setSkin(skin)
  skin.setText(title)
 
  def setText(text: String): Unit = {
    getSkin(getSkin()).setText(text)
  }
 
  def setOnMouseClicked2(eh: EventHandler[MouseEvent]): Unit = {
    getSkin(getSkin()).setOnMouseClicked2(eh)
  }
 
  def setDirection(direction: Integer): Unit = {
    getSkin(getSkin()).setDirection(direction)
  }
 
  private def getSkin(skin: Skin[_]): ArrowButtonSkin = {
    return skin.asInstanceOf[ArrowButtonSkin]
  }
}
